var wh = $(window).height();
$(function(){
	init();
});
function init(){
	e();
	s();
}

function e(){
	$(window).scroll(function () {
		if (($(this).scrollTop()>(1400-wh)) && ($(this).scrollTop()<2500)) {
		// console.log((1500-1020)*(($(this).scrollTop()-1400+wh)/(2500-1400+wh)));
			$(".part3-bg").css({
				"-webkit-transform":"translateY(-"+(1500-1020)*(($(this).scrollTop()-1400+wh)/(2500-1400+wh))+"px)"
			});	
		}
	});
}

// swiper初始化
function s(){
	// 首页banner
	homeBanner = new Swiper(".homeBanner",{
        slidesPerView: 1,
        autoplay: 3000,
        loop: true,
        pagination : '.homeBanner-pagination',
        paginationClickable :true
	});
    $(".homeBanner").hover(function () {
        homeBanner.stopAutoplay();
    }, function () {
        homeBanner.startAutoplay();
    });
}